package com.xishu.task;

import com.xishu.config.Config;
import com.xishu.service.CommonService;
import com.xishu.util.Tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class CleanTask implements Tools {
    private static Logger logger = LoggerFactory.getLogger(CleanTask.class);
    private CommonService commonService = CommonService.getInstance();
    private Config config = Config.getInstance();

    //每一个小时执行一次，但是只在每天3点凌晨执行，扫描前3天的订单，删除超过一天，但是未支付的订单
    //只在主节点执行
//    @Scheduled(initialDelay = 0, fixedDelay = 60 * 60 * 1000)
    public void action() throws Exception {
    }


    /**
     * 哪些时间段只可以清除标记
     *
     * @return
     */
    public List<String> getCleanTimeRange() {
        List<String> timeList = new ArrayList<>();
        timeList.add("01");
        timeList.add("02");
        timeList.add("03");
        timeList.add("04");
        timeList.add("05");
        return timeList;
    }

}
